print("arg:",arg[1],arg[2],arg[3])
local addr = tonumber(arg[1]);
local file1 = io.open(arg[2],"rb");
local file2 = io.open(arg[3],"r+b");

assert(file1);
assert(file2);

addr = addr - 0x08000000;
file2:seek("set",addr);
local data = file1:read('*a');
file2:write(data);
